#include <stdio.h>
#include <algorithm>
#define MAX 1000001

using namespace std;

long long int leng[MAX]={0};

int main(){
  leng[1]=1;

  int a,b;
  while(scanf("%d %d", &a, &b)!=EOF){
    int min_ab = min(a,b);
    int max_ab = max(a,b);

    for(int k= min_ab; k<=max_ab; k++){
      long long temp=k;
      long long count=0;
      while(true){
	if(temp<MAX && leng[temp]!=0){
	  leng[k]=count+leng[temp];
      	  break;
	}
	if(temp%2){
	  temp = 3*temp + 1;
	}else{
	  temp/=2;
	}
	count++;
      }//end of while
    }//end of for

    long long maxi=0;
    for(int i=min_ab;i<=max_ab;i++){
      if(leng[i]>maxi){
	maxi=leng[i];
      }
    }
    printf("%d %d %lld\n", a, b, maxi);
  }
}
